set the visible of card field 1 to not the visible of card field 1
if the visible of card field 1 is true then
set the name of me to "Hide Pascal Source"
else set the name of me to "Show Pascal Source"
end mouseUp
-- part 3 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=12 top=26 right=298 bottom=491
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 22
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name: Source
-- part contents for background part 16
----- text -----
SIZECARDWINDOW XCMD version 1.0
Kevin Calhoun
SizeCardWindow sets the size of the HyperCard window.
If you make the window larger than the standard size of 512 by 342 pixels, HyperCard is unable to use the extra space (this applies to version 1.2.2 and earlier, and to every version of HyperCard until one, which may or may not someday appear, in which this XCMD becomes obsolete). SizeCardWindow is only useful for making the window temporarily smaller, which is desirable, for instance, if you want to see other windows.
INVOKING SIZECARDWINDOW
SizeCardWindow <horizontalSize>,<verticalSize>
SizeCardWindow takes zero, one, or two parameters. If no parameters are passed, SizeCardWindow sets the size of the card window to its standard size, 512 by 342 pixels. If one parameter is passed, SizeCardWindow makes the window horizontalSize pixels wide and 342 pixels tall. If two parameters are passed, SizeCardWindow makes the window horizontalSize pixels wide and verticalSize pixels tall. If either horizontalSize or verticalSize is an empty string, SizeCardWindow substitutes the standard measurement for the dimension it represents. If either horizontalSize or verticalSize is a negative number, SizeCardWindow does nothing.
-- part contents for card part 3
----- text -----
UNIT GotGrafPortWillWreakHavoc;
{ SizeCardWindow XCMD ©1989 by the Trustees of Dartmouth College }
{ Written by Kevin Calhoun }
{ This source compatible with MPW Pascal 3.0 }
(*
Pascal SizeCardWindow.p
Link -m ENTRYPOINT Γêé
-o "YourFile" Γêé
-rt XCMD=3389 Γêé
-sn Main=SizeCardWindow Γêé
SizeCardWindow.p.o Γêé
"{Libraries}"HyperXLib.o
*)
{$R-}
INTERFACE
USES
Types,
Windows,
ToolUtils,
HyperXCmd;
PROCEDURE EntryPoint(paramPtr: XCMDPtr);
IMPLEMENTATION
PROCEDURE SizeCardWindow(paramPtr: XCMDPtr);
FORWARD;
PROCEDURE EntryPoint;
BEGIN
SizeCardWindow(paramPtr);
END;
PROCEDURE SizeCardWindow(paramPtr: XCMDPtr);
VAR
params: INTEGER;
cardWindow: WindowPtr;
str: Str255;
w, h: LONGINT;
BEGIN
GetPort(GrafPtr(cardWindow));
params := paramPtr^.paramCount;
w := 512;
h := 342;
IF params >= 1 THEN
BEGIN
ZeroToPas(paramPtr, paramPtr^.params[1]^, str);
IF LENGTH(str) > 0 THEN w := StrToNum(paramPtr, str);
IF params = 2 THEN
BEGIN
ZeroToPas(paramPtr, paramPtr^.params[2]^, str);
IF LENGTH(str) > 0 THEN h := StrToNum(paramPtr, str);